import { Column, Entity, Index, JoinColumn, ManyToOne } from 'typeorm';
import { CommonEntity } from '~/common/entity/common.entity';
import { UserEntity } from '~/modules/user/user.entity';
import { ArticleContentEntity } from '../article-content.entity';

@Entity('ah_article_content_user_review')
@Index(['id'])
export class ArticleContentUserReviewEntity extends CommonEntity {
  @ManyToOne(() => UserEntity, (user) => user.articleContentUserReview)
  @JoinColumn({ name: 'user_id' })
  user: UserEntity;

  @ManyToOne(() => ArticleContentEntity, (article) => article.articleContentUserReview)
  @JoinColumn({ name: 'article_id' })
  article: ArticleContentEntity;

	@Column('decimal', { precision: 2, scale: 1, nullable: true, comment: '帮助评分', name: 'helpfulness_score', default: 0 })
	helpfulnessScore: number;

	@Column('decimal', { precision: 2, scale: 1, nullable: true, comment: '推送满意度评分', name: 'push_satisfaction_score', default: 0 })
	pushSatisfactionScore: number;

	@Column('decimal', { precision: 2, scale: 1, nullable: true, comment: '内容满意度评分', name: 'content_satisfaction_score', default: 0 })
	contentSatisfactionScore: number;
}

